
import cn.hutool.json.JSONUtil;
import java.util.*;
public class Main {
    //nums = [3,3], target = 6
    public static void main(String[] args) {
        String numsStr = args[0];
        String targetStr = args[1];
        // 步骤1：去除首尾的 []
        String trimmed = numsStr.substring(1, numsStr.length() - 1); // 结果：" 1, 2, 3 "

        // 步骤2：去除所有空格
        String noSpaceStr = trimmed.replaceAll(" ", ""); // 结果："1,2,3"

        // 步骤3：按逗号分割
        String[] strElements = noSpaceStr.split(","); // 结果：["1", "2", "3"]

        // 步骤4：转换为 int 数组
        int[] nums = new int[strElements.length];
        for (int i = 0; i < strElements.length; i++) {
            nums[i] = Integer.parseInt(strElements[i]);
        }
        int target = Integer.parseInt(targetStr);
        Solution solution = new Solution();
        int ans [] = solution.twoSum(nums,target);
        System.out.println( JSONUtil.toJsonStr(ans));
    }
    }
class Solution {
    public int[] twoSum(int[] nums, int target) {
        int n = nums.length;
        for (int i = 0; i < n; ++i) {
            for (int j = i + 1; j < n; ++j) {
                if (nums[i] + nums[j] == target) {
                    return new int[]{i, j};
                }
            }
        }
        return new int[0];
    }
}

 class TreeNode {
      int val;
      TreeNode left;
      TreeNode right;
      TreeNode() {}
      TreeNode(int val) { this.val = val; }
      TreeNode(int val, TreeNode left, TreeNode right) {
          this.val = val;
          this.left = left;
          this.right = right;
      }
  }

